{% extends 'admin/common/base.html' %}
{% block css %}
{{super()}}
<link href="{{url_for('admin.static',filename='ajax/libs/jasny/jasny-bootstrap.min.css')}}?v=3.1.3" rel="stylesheet"/>
{% endblock %}
{% block body %}
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form">
            <div class="form-group">
				<label class="col-sm-3 control-label">名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" value="">
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label ">类型：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="mtype" id="mtype" value="">
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">图片：</label>
				<div class="col-sm-8">
                    <div class="fileinput fileinput-new" data-provides="fileinput">
                        <div class="fileinput-new thumbnail" style="max-width: 300px;min-width: 140px;">
                            <img src="">
                        </div>
                        <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"></div>
                        <div>
                            <span class="btn btn-white btn-file"><span class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span><input type="file" name="img"></span>
                            <a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
                        </div>
                    </div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">视频地址：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="video" id="video" value="">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">排序：</label>
				<div class="col-sm-8">
					<input class="form-control" type="number" name="order_num" id="order_num" value="0" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label ">链接：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="url" id="url" value="">
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label ">备注：</label>
				<div class="col-sm-8">
                    <textarea id="remark" name="remark" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
</body>
{% endblock %}
{% block js %}
{{ super() }}
<script src="{{url_for('admin.static',filename='ajax/libs/jasny/jasny-bootstrap.min.js')}}?v=3.1.3"></script>
<script type="text/javascript">

    
    $("#form").validate({

    });
    
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("{{url_for('admin.cms.banner.add')}}", new FormData(document.getElementById('form')));
        }
    }

</script>
{% endblock %}
